<?php

use app\common\service\UrlService;
use app\common\service\StaticService;

StaticService::includeAppJsStatic("/js/web/yuyue/index.js", app\assets\AdminAsset::className());
?>
<div class="row  border-bottom">
    <div class="col-lg-12">
        <div class="tab_title">
            <ul class="nav nav-pills">
                <li class="current">
                    <a href="/admin/yuyue/index">预约列表</a>
                </li>
            </ul>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-lg-12">
        <form class="form-inline wrap_search">
            <div class="row m-t p-w-m">
                <div class="form-group">
                    <select name="status" class="form-control inline">
                        <option value="-1">请选择状态</option>
                        <option value="0" <?php if ($search_conditions['status'] == 0): ?>selected<?php endif; ?>>未完成
                        </option>
                        <option value="1" <?php if ($search_conditions['status'] == 1): ?>selected<?php endif; ?>>已完成
                        </option>
                    </select>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <input type="text" name="mix_kw" placeholder="请输入姓名或者手机号码" class="form-control"
                               value="<?= $search_conditions['mix_kw'] ?>">
                        <input type="hidden" name="p" value="1">
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-primary search">
                                <i class="fa fa-search"></i>搜索
                            </button>
                        </span>
                    </div>
                </div>
            </div>
            <hr/>
            <!--            <div class="row">-->
            <!--                <div class="col-lg-12">-->
            <!--                    <a class="btn btn-w-m btn-outline btn-primary pull-right" href="/admin/account/set">-->
            <!--                        <i class="fa fa-plus"></i>账号-->
            <!--                    </a>-->
            <!--                </div>-->
            <!--            </div>-->
        </form>

        <table class="table table-bordered m-t">
            <thead>
            <tr>
                <th>预约时间</th>
                <th>微信昵称</th>
                <th>手机</th>
                <th>作业名称</th>
                <th>备注</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($list as $item): ?>
                <tr>
                    <td><?= $item['time'] ?></td>
                    <td><?= $item['member_nickname'] ?></td>
                    <td><?= $item['phone'] ?></td>
                    <td><?= $item['name'] ?></td>
                    <td><?= $item['remark'] ?></td>
                    <td>
                        <a href=<?= UrlService::buildAdminUrl("/yuyue/info", ['id' => $item['id']]); ?>>
                            <i class="fa fa-eye fa-lg"></i>
                        </a>
                        <?php if (!$item['status']): ?>
                            <a class="m-l" href=<?= UrlService::buildAdminUrl("/yuyue/set", ['id' => $item['id']]); ?>>
                                <i class="fa fa-edit fa-lg"></i>
                            </a>
                            <a class="m-l remove"
                               href=<?= UrlService::buildNullUrl() ?> data="<?= $item['id'] ?>">
                                <i class="fa fa-trash fa-lg"></i>
                            </a>

                            <a class="m-l recover"
                               href=<?= UrlService::buildNullUrl() ?> data="<?= $item['id'] ?>">
                                <i class="fa fa-rotate-left fa-lg"></i>
                            </a>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>

        <?php echo \Yii::$app->view->renderFile("@app/modules/admin/views/common/pagination.php", [
            'pages' => $pages,
            'url' => '/yuyue/index',
            'search_conditions' => [],
        ]); ?>

    </div>
</div>

